package net.lb.socketserver.transfer.server;

import net.lb.beancontext.core.bean.BeanConfig;
import net.lb.socketserver.handler.impl.auth.AuthHandler;

public class AuthServerMain extends ServerMain
{
    protected AuthServerMain()
    {
        
    }
    
    public AuthServerMain(ServerConfig serverConfig, BeanConfig... beanConfigs)
    {
        serverConfig.addPackageNames("net.lb.socketserver:out~net.lb.socketserver*des");
        init(serverConfig, beanConfigs);
    }
    
    protected void init(ServerConfig serverConfig, BeanConfig... beanConfigs)
    {
        super.init(serverConfig, beanConfigs);
        AuthHandler authHandler = beanContext.getBeanByOriginType(AuthHandler.class);
        authHandler.setPublicKey(serverConfig.getPublicKey());
    }
}
